import pygame
from pygame.locals import *
import keylistener
import entitybuilder

class Scene(pygame.Surface, keylistener.KeyListener):
    def __init__(self):
        self.backgroup = pygame.display.set_mode((800, 600))
        pygame.display.set_caption("Client")
        self.player = entitybuilder.EntityBuilder().BuildPlayer()
        self.player_group = pygame.sprite.Group()
        self.player_group.add(self.player.GetComponent("sprite"))

    def Update(self, ticks):
        self.backgroup.fill((50, 50, 100))
        self.player_group.update(ticks, 60)
        self.player_group.draw(self.backgroup)
        pygame.display.flip()

    def KeyDown(self, key):
        print("KeyDown", key)

    def KeyPressed(self, key):
        print("KeyPressed", key)

